package com.itboye.mengwu.data.repository;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.reflect.TypeToken;
import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.utils.BaseErrorListener;
import com.itboye.core.utils.BaseSuccessReqListener;
import com.itboye.core.utils.ByJsonRequest.Builder;
import com.itboye.mengwu.data.interfaces.IAddGoods;
import com.itboye.mengwu.data.interfaces.IKeyWordsQuery;
import com.itboye.mengwu.data.model.AppHeadPage;
import com.itboye.mengwu.data.model.GoodsListModel;
import com.itboye.mengwu.data.model.KeyWordQueryModel;

public class KeyWordQueryRepository extends BaseNetRepository implements
		IKeyWordsQuery<KeyWordQueryModel> {
	public static final String Query = "BY_Product_searchWords";

	public KeyWordQueryRepository(ICompleteListener listener) {
		// TODO Auto-generated constructor stub
		super(listener);
	}

	@Override
	public void add(KeyWordQueryModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void delete(KeyWordQueryModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(KeyWordQueryModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void getInfo(KeyWordQueryModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public List<KeyWordQueryModel> queryYouHuiQuan(KeyWordQueryModel model) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void WordQuery(String sort) {
		// TODO Auto-generated method stub
		String apiVer = "100";
		Type type = new TypeToken<ArrayList<KeyWordQueryModel>>() {
		}.getType();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("sort", sort);
		(new Builder<ArrayList<KeyWordQueryModel>>())
				.setTypeVerParamsAndReturnClass(Query, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<ArrayList<KeyWordQueryModel>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

}
